package org.example.lang;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @Title : LocalDateTimeTest
 * @Description:
 * @author: libo@juzishuke.com
 * @date: 2023/12/11 14:13
 * @Version:1.0
 */
public class LocalDateTimeTest {

    public static void main(String[] args) {

        LocalDateTime ldt = LocalDateTime.now();
        System.out.println(ldt);
        ldt = ldt.withYear(2024).withMonth(12).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        System.out.println(ldt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        System.out.println(ldt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
    }

}
